package com.xci.core.internal;

import com.xci.core.setting.AppSetting;
import com.xci.sys.service.*;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 应用程序启动后系统缓存初始化
 * @author 吕艳阳
 */
@Order(value = 0)
public class SysRunner implements ApplicationRunner {
    @Resource
    private AppService appService;
    @Resource
    private ParamService paramService;
    @Resource
    private UserService userService;
    @Resource
    private DeptService deptService;
    @Resource
    private RoleService roleService;
    @Resource
    private DicService dicService;

    @Override
    public void run(ApplicationArguments args) {
        appService.refreshCache();
        paramService.refreshCache();
        dicService.refreshCache();
        deptService.refreshCache();
        userService.refreshCache();
        roleService.refreshCache();
    }
}
